import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/home'
import city from '@/pages/city/city'
import deta from '@/pages/deta/deta'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },{
      path: '/city',
      name: 'city',
      component: city
    },{
      path: '/deta/:id',
      name: 'deta',
      component: deta
    }
  ],
  scrollBehavior (to, from, savedPosition) { //页面切换的时候 始终是最顶部
    return { x: 0, y: 0 }
  }
})
